<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>基本信息</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<link rel="stylesheet" href="assets/layui/css/layui.css">
</head>
<body>

	<!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
	<!--[if lt IE 9]>
		  <script src="assets/js/html5.min.js"></script>
		  <script src="assets/js/respond.min.js"></script>
		<![endif]-->
	<form id="changData" class="layui-form" onsubmit="return false" style="padding:50px 50px 0 50px">
		<div class="layui-form-item">
			<label class="layui-form-label">昵称:</label>
			<div class="layui-input-inline">
				<input id="" type="text" name="username" autocomplete="off" class="layui-input" value="丽丽" lay-verify="required|name">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">电话:</label>
			<div class="layui-input-inline">
				<input id="" type="text" name="phone" lay-verify="required|phone" autocomplete="off" class="layui-input" value="13641138223">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">邮箱:</label>
			<div class="layui-input-inline">
				<input id="" type="text" name="mail" lay-verify="required|mail" autocomplete="off" class="layui-input" value="45622@qq.com">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">公司名称:</label>
			<div class="layui-input-inline">
				<input id="" type="text" name="company" lay-verify="required|company" autocomplete="off" class="layui-input" value="聚车拍">
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-inline" style="min-width:750px">
				<label class="layui-form-label">公司地址</label>
				<div class="layui-input-inline">
					<select name="provid" id="provid" lay-filter="provid">
						<option value="">请选择省</option>
					</select>
				</div>
				<div class="layui-input-inline">
					<select name="cityid" id="cityid" lay-filter="cityid">
						<option value="">请选择市</option>
					</select>
				</div>
				<div class="layui-input-inline">
					<select name="areaid" id="areaid" lay-filter="areaid">
						<option value="">请选择县/区</option>
					</select>
				</div>
			</div>
		</div>
		<div class="layui-form-item" style="text-align:center;margin-top:30px;">
			<button class="layui-btn" lay-submit="" lay-filter="submitBtn">确认</button>
			<button class="layui-btn cancel-btn">取消</button>
		</div>
	</form>

	<script src="assets/layui/layui.js"></script>
	<script src="assets/js/jquery-2.1.0.js"></script>

	<!--省市地区选择-->
	<script type="text/javascript" src="assets/js/data.js"></script>
	<script type="text/javascript" src="assets/js/province.js"></script>
	<script type="text/javascript">
		var defaults = {
			s1: 'provid',
			s2: 'cityid',
			s3: 'areaid',
			v1: null,
			v2: null,
			v3: null
		};
		
		//获取地区值
//		$(".register-btn").click(function(){
//			var provName = $("#provid option:selected").text();
//			var cityName = $("#cityid option:selected").text();
//			var areaName = $("#areaid option:selected").text();
//			var locationName = provName + cityName + areaName;
//			alert(locationName);
//		})
	</script>
	<!--//省市地区选择-->
	<script src="assets/js/all.js"></script>
	<script type="text/javascript">
		layui.use(['form','layer','element'],function(){
			var form = layui.form,
				layer = layui.layer,
				$ = layui.$;
			//表单验证
			form.verify({
				phone: [/^1[3|4|5|8][0-9]\d{4,8}$/, '手机号码不正确'],
				mail:[/^[A-Za-z\d]+([-_.][A-Za-z\d]+)*@([A-Za-z\d]+[-.])+[A-Za-z\d]{2,4}$/, '邮箱地址不正确']
			});
			//监听提交
			form.on('submit(submitBtn)',function(data){				
				//var formData = $("#changData").serialize();
				//console.log(data.field);
				$.ajax({
					type:"post",
					url:"",
					data:data.field,
					dataType:'json',
					success:function(res){
						layer.msg(res.msg);
					}
					
				});
				return false;
			});
			$(".cancel-btn").on("click",function(){
				var index = parent.layer.getFrameIndex(window.name);
				parent.layer.close(index);
			})

		})
	</script>
</body>
</html>
